﻿; (function (global) {

    'use strict';


    global.IndicesHelper = global.IndicesHelper || {};


    IndicesHelper.getRankFromIndices = function (indices) {
        return indices.i * 9 + indices.j;;
    }

    IndicesHelper.getIndicesFromRank = function (rank) {
        var i = rank / 9 | 0;
        var j = rank - (i * 9);
        return { i: i, j: j };
    }

    IndicesHelper.AreEqual = function (indices1, indices2) {
        return indices1.i == indices2.i && indices1.j == indices2.j;
    }

}(this));
